<div ng-controller="SelectPatientCtrl" ng-init="init()">

    <div class="bg-light lter b-b wrapper-md">
        <span class="m-n font-thin h3">
        	<span class="font-bold">{{'common.application' | translate}}{{serviceType.service_Name}} - </span>
            <span class="font-bold" translate="aside.nav.process.selectPatient"></span>
        </span>
        <span ng-if="!isSmart" class="pull-right"><a class="btn btn-primary font-bold" ui-sref="app.process.service({service_Id:service_Id})"><span translate="common.backList"></span></a></span>
    </div>
    <div class="wrapper-md">
        <div class="panel panel-default">
            <div class="col-xs-10 col-sm-6 input-group" style="margin:15px;">
                <input type="text" class="form-control"
                       placeholder="{{'business.navtitle.keyword' | translate}}" autocomplete="off"
                       ng-model="like">
                <span class="input-group-addon btn btn-success" ng-click="searchPatient()"
                      translate="business.navtitle.search_patient"></span>
            </div>
            <table class="table table-striped" style="width:100%" dt-disable-deep-watchers="true"
                   ui-options="dtOptions">
                <thead>
                <tr>
                    <th translate="business.patcase.id"></th>
                    <th translate="common.name"></th>
                    <th translate="user.gender" ng-if="!isSmart"></th>
                    <th translate="user.mobilephone" ng-if="!isSmart"></th>
                    <th translate="common.operate"></th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="model in patients" class="row-sm-12">
                    <td>P-{{ model.patient_Id }}</td>
                    <td>{{ model._user.realName }}</td>
                    <td ng-if="!isSmart">
                            <span ng-show="model._user.gender != null">
                            {{ 'user.gender.' + model._user.gender  | translate}}
                            </span>
                    </td>
                    <td ng-if="!isSmart">
                        {{ model._user.mobile_Phone }}
                    </td>
                    <td>
                        <a type="button" class="btn btn-sm btn-info font-bold"
                           ui-sref="app.process.serviceCreate({ patient_Id:model.patient_Id,service_Id:service_Id })"
                           translate="common.select"></a>
                    </td>
                </tr>
                </tbody>
            </table>
            <footer class="panel-footer">
                <div class="row">
                    <div class="col-sm-4 text-left">
                        <small class="text-muted inline m-t-sm m-b-sm"><span translate="common.showing"></span>
                            {{page.totalItems==0?0:(page.currentPage-1)*page.itemsPerPage+1}}
                            - {{(page.currentPage-1)*page.itemsPerPage+page.currentItems}}
                            <span translate="common.of"></span> {{page.totalItems}} <span translate="common.items"></span>
                        </small>
                    </div>
                    <div class="col-sm-8 text-right text-center-xs">
                        <pagination ng-model="page.currentPage" ng-change="pageChanged()"
                                    total-items="page.totalItems" items-per-page="page.itemsPerPage"
                                    max-size="page.maxSize" class="pagination-sm m-t-none m-b"
                                    boundary-links="true" rotate="false" previous-text="&lsaquo;"
                                    next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;">
                        </pagination>
                    </div>
                </div>
            </footer>
        </div>
    </div>
</div>

<div ng-include="'views/work/templates.html'"></div>